<template>
  <a-config-provider :get-popup-container="getPopupContainer" :locale="zhCN" prefix-cls="micro-ant">
    <router-view v-slot="{ Component, route }">
      <keep-alive :include="store.state.keepAliveList">
        <component :is="Component" :key="route.path" />
      </keep-alive>
    </router-view>
  </a-config-provider>
</template>

<script setup>
import { ConfigProvider, Message } from 'ant-design-vue';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
import store from './store';
import 'dayjs/locale/zh-cn';
Message.config({
  top: '100px'
});
// const store = useStore();
dayjs.locale('en');
function getPopupContainer(el, dialogContext) {
  if (el) {
    return el.parentNode;
  }
  if (dialogContext) {
    return dialogContext.getDialogWrap();
  }
  if (!window.__MICRO_APP_ENVIRONMENT__) {
    return document.body;
  }
  return el ?? document.body;
}

ConfigProvider.config({
  getPopupContainer
});
</script>
<style lang="less"></style>
